<template>
    <div>
        <h2 style="margin-left: 450px;margin-top: 20px;">项目经历</h2>
    </div>
    <el-timeline style="margin-top: 20px;margin-left: 70px; width: 900px;">
    
      <el-timeline-item :timestamp="l.date" placement="top" v-for="(l,index) in projectData.list" :key="index">
    
        <el-card>
          <h4 v-text="l.projectname"></h4>
          <p v-text="l.descript"></p>
        </el-card>
      </el-timeline-item>
      
    </el-timeline>
  </template>
  
<script setup>

import { ref } from "vue";
import API from "../pluging/axiosInstance.js";
import { useRoute } from 'vue-router'
import { reactive } from "vue";


const route = useRoute()
const name = route.query.name
const id = route.query.id
console.log("project id:"+id)
function getData () {
   API({
    url: "/home/project",
    method: "post",
    data: {
       id:id
    },
  }).then((res) => {
    console.log(res.data)
    projectData.list=res.data.dataList
    console.log("请求成功!" + "请求数据：");
    console.log('项目名称：'+projectData.list[currentId].projectname );

    // console.log(loginData.id)
  });
};

getData()

const projectData = reactive({
  list:[{
    projectid:'',
    projectname:'',
    level: "",
    degree:'',
    descript: "",
    date:''
  }]
});

const  currentId=0;












const list=[{
  projectname:'html+css项目',
  descript:'简单的html+css项目',
  date:'2033-2-4'
},{
  projectname:'前后端分离项目',
  descript:'敲敲打打前后端分离项目',
  date:'2021-4-5'
}]

</script>